package com.uinnova.springboot.mongodb;

import com.uinnova.springboot.mongodb.User;
import com.uinnova.springboot.mongodb.dao.UserMongo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;

@Service
public class UserService {

/*
*@author 王刚
*@date 2019-01-07 08:53
*用户增删改查
*/
@Autowired
private UserMongo userMongo;

public void saveUser(User user){
    userMongo.saveUser(user);
}

public void deleteUser(String id){
   userMongo.deleteUserById(id);
}

public void updateUser(User user){
    userMongo.updateUser(user);
}

public User queryByName(String name){
    return userMongo.findUserByName(name);
}

}
